package com.imonsoft.sqm.web.basedata;

import com.imonsoft.common.constant.ConstantSqm;
import com.imonsoft.sqm.pojo.basedata.IpicRule;
import com.imonsoft.sqm.service.basedata.IpicRuleService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;

@Controller
@RequestMapping("/basedata/ipic_rule")
public class IpicRuleController {
    protected final Log logger = LogFactory.getLog(getClass());
    @Autowired
    private IpicRuleService ipicRuleService;


    @RequestMapping("/listUI.do")
    public void listUI(ModelMap model) {
        List<IpicRule> ppmList=ipicRuleService.findIpicRuleByType(ConstantSqm.IPIC_RULE_TYPE_PPM);
        model.put("ppmList", ppmList);
        List<IpicRule> claimValueList=ipicRuleService.findIpicRuleByType(ConstantSqm.IPIC_RULE_TYPE_CLAIM_VALUE);
        model.put("claimValueList", claimValueList);
        List<IpicRule> claimQuantityList=ipicRuleService.findIpicRuleByType(ConstantSqm.IPIC_RULE_TYPE_CLAIM_QUANTITY);
        model.put("claimQuantityList", claimQuantityList);
    }

}
